<?
if ( ($_REQUEST['jenis_dokumen'] == '1') || ($_REQUEST['jenis_dokumen'] == '2')) {
	$editable_hash['master_profil_tarikh_lahir'] = "readonly style=\"background-color:#cecece\"";
	
	$editable_hash['master_profile_agama_id'] = 'readonly onfocus="this.blur()" style="background-color:#cecece"';
	// Gmi edited 17/02/2011 requested by HISHAM
	//$editable_hash['master_profile_kod_kaum'] = 'readonly onfocus="this.blur()" style="background-color:#cecece"';
	// bapa 
	$editable_hash['profile_bapa_nama'] = "readonly  style=\"background-color:#cecece\"";
	$editable_hash['profile_bapa_no_kp'] = "readonly style=\"background-color:#cecece\"";
	$editable_hash['profile_bapa_warganegara_id'] = "";
	// ibu                
	$editable_hash['profile_ibu_nama'] = "readonly style=\"background-color:#cecece\"";
	$editable_hash['profile_ibu_no_kp'] = "readonly style=\"background-color:#cecece\"";
	$editable_hash['profile_ibu_warganegara_id'] = "";
}else{
	$editable_hash['master_profil_tarikh_lahir'] = "readonly";
}
?>
<fieldset style="background:#ffffff; border-width:thin; border-style:solid; padding:10px; border-color:#CCCCCC;">
<legend style="font-size:1.0em; font-weight: bold;">Fail</legend>
<table width="100%" cellspacing="1" cellpadding="2" border="0" class="classBackground">
  <tbody>
    <tr>
      <td width="20" align="left" valign="top" class="color_606060">&nbsp;</td>
      <td width="30%" align="left" valign="top">Nama Fail </td>
      <td width="30">:</td>
      <td><input type="file" name="the_file" /></td>
    </tr>
  </tbody>
</table>
<center>
<span class="TableRowLeft"><br />
<input name="button233" type="submit" class="Button" onclick="" value="Muat Naik" style=" width:100px;" />
</span>
</center>

</fieldset>

<script>

function GoSubmit(df) {

	//if (!checkSelection(strRegExp,$('kod'),'Kod Institusi')) return false;
	if (!checkInput(/.*/,$('master_profil_nama'),'Nama Murid')) return false;

<? if ($_REQUEST['jenis_dokumen'] == '1') {?>
	if (!checkInput(icnumRegExp,$('master_profile_no_kp'),'No. MyKid')) return false;
<? } ?>
<? if ($_REQUEST['jenis_dokumen'] == '2') {?>
	if (!checkInput(/.*/,$('master_profile_no_surat_beranak'),'No. Surat Beranak')) return false;
<? } ?>
<? if ($_REQUEST['jenis_dokumen'] == '3') {?>
	if (!checkInput(/.*/,$('master_profile_no_passport'),'No. Passport')) return false;
<? } ?>

	if (!checkInput(/.*/,$('f_rangeStart'),'Tarikh Lahir')) return false;
	//if (!checkRadio(/.*/,$('jantina'),'Jantina')) return false;
	var $jantina_checked = false;
	if ( $('kod_jantina_L').checked || $('kod_jantina_P').checked ) {
		$jantina_checked = true;
	}
	if (!$jantina_checked) {
		alert("Sila pilih jantina.");
		$('kod_jantina_L').style.color='red';
		$('kod_jantina_L').focus();
		return false;
	}
	
	if (!checkSelection(/.*/,$('master_profile_agama_id'),'Agama')) return false;
	if (!checkSelection(/.*/,$('master_profile_kod_kaum'),'Keturunan')) return false;	
	if (!checkSelection(/.*/,$('master_profil_negeri_kelahiran_id'),'Negeri Kelahiran')) return false;


	//if (!checkRadio(/.*/,$('warga'),'Warganegara')) return false;
	var $warganegara_checked = false;
	if ( $('warga_W').checked || $('warga_B').checked ) {
		$warganegara_checked = true;
	}
	if (!$warganegara_checked) {
		alert("Sila pilih taraf warganegara.");
		$('warga_W').style.color='red';
		$('warga_W').focus();
		return false;
	}
	
	if (!checkInput(/.*/,$('master_alamat_alamat1'),'Alamat')) return false;
	
	if (!checkInput(postcodeRegExp,$('master_alamat_poskod'),'Poskod')) return false;
	if (!checkInput(/.*/,$('bandar'),'Bandar')) return false;
	if (!checkSelection(/.*/,$('master_alamat_negeri_id'),'Negeri')) return false;	
	if (!checkRadio(strRegExp,$('status_murid'),'Status Murid')) return false;	
	
	if (!checkSelection(/.*/,$('murid_maklumat_oku_id'),'Maklumat OKU')) return false;	

	// maklumat penjaga
	if (!checkInput(/.*/,$('profile_bapa_nama'),'Nama Bapa')) return false;
	if (!checkInput(/.*/,$('profile_bapa_no_kp'),'No. Kad Pengenalan/Passport Bapa')) return false;
	if (!checkInput(/.*/,$('bapa_kerja_id'),'Pekerjaan')) return false;
	if (!checkInput(numRegExp,$('bapa_pendapatan'),'Pendapatan(RM)')) return false;
	if (!checkRadio(/.*/,$('warga_bapa'),'Taraf Warganegara Bapa')) return false;	
	
	// ibu
	if (!checkInput(/.*/,$('profile_ibu_nama'),'Nama Ibu')) return false;
	if (!checkInput(/.*/,$('profile_ibu_no_kp'),'No. Kad Pengenalan/Passport Ibu')) return false;
	if (!checkInput(/.*/,$('ibu_kerja_id'),'Pekerjaan Ibu')) return false;
	if (!checkInput(numRegExp,$('ibu_pendapatan'),'Pendapatan(RM) Ibu')) return false;
	if (!checkRadio(/.*/,$('warga_ibu'),'Taraf Warganegara Ibu')) return false;	
	

	//if (!checkInput(anythingRegExp,$('profile_name'),'Nama Penuh Pemohon')) return false;
	//if (!checkInput(anything,$('profile_fax'),'Nombor Fax')) return false;

	return true;
}

function validate(evt) {
  var theEvent = evt || window.event;
  var key = theEvent.keyCode || theEvent.which;
  key = String.fromCharCode( key );
  var regex = /[0-9]|[\b]/;
  if( !regex.test(key) ) {
    theEvent.returnValue = false;
    theEvent.preventDefault();
  }
}




// kira check julat pendapatan
function kiraJulatPendapatan(pendapatan, targetId){
	var el = document.getElementById(targetId);
	pendapatan = parseInt(pendapatan);
	var checkThis = /\d+/g;
	var checkThisLess = /</g;
	var checkThisMore = />/g;
	var limit_arr = new Array();
	selected_val = 0;
	for(var i=1; i<el.length; i++){
		var opt_val = el.options[i].value;
		var opt_text = el.options[i].text;

		if(a = opt_text.match(checkThis)){
			if(a.length == 1){
				if(opt_text.match(checkThisLess)){ // < value ; 0 ~ value
					limit_arr[opt_val] = parseInt(a[0]);
 					if(pendapatan <= parseInt(a[0])){
						selected_val = opt_val;
						break; 
					}
				}
				if(opt_text.match(checkThisMore)){ // > value ; value ~ inf
					limit_arr[opt_val] = 99999999;
 					if(pendapatan >= parseInt(a[0])){
						selected_val = opt_val;
						break; 
					}
				}
			}
			
			if(a.length == 2){ // ada range 
				limit_arr[opt_val] = a[1];
 				if(pendapatan <= parseInt(a[1])){
					selected_val = opt_val;
					break;
				}
			}
		}
	}
	return el.selectedIndex = selected_val;
}

</script>

          <div id="cont" style=" display:none"></div>
          <script type="text/javascript">
            var LEFT_CAL = Calendar.setup({
                    cont: "cont",
                    weekNumbers: true,
                    selectionType: Calendar.SEL_MULTIPLE,
                    showTime: 12
                    // titleFormat: "%B %Y"
            })
          </script>


